/**
 * iOS Apple Push Notification Service extension example
 * @author Piotr Koscierzynski, flashsimulations.com
 * 
 * 
 * 
 * */

import flash.events.MouseEvent;
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;

import mx.events.FlexEvent;

import pl.randori.air.nativeextensions.ios.APNSExtension;
import pl.randori.air.nativeextensions.ios.APNSExtensionEvent;

private var apnServiceExtension:APNSExtension; 

//Example call
private function register() : void {
	apnServiceExtension.registerForRemoteNotifications();
}

protected function onRemoteNotificationEvent(e:APNSExtensionEvent):void {
	//infoArea.text += '\nReceived event: '+e.eventInfo;
	app_log += ("<line " + app_log_line_num.toString() + "> : " + e.eventInfo + "\n");
	app_log_line_num += 1;
}

protected function listenForPush():void
	
{
	apnServiceExtension = new APNSExtension();
	apnServiceExtension.addEventListener(APNSExtensionEvent.APN_SERVICE_EVENT, onRemoteNotificationEvent);
	
	
	// TODO Auto-generated method stub
	
	
	register();
}